package com.lzxuni.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lzxuni.mapper.RhDataMapper;
import com.lzxuni.po.QxDataCostom;
import com.lzxuni.po.RhDataCustom;
import com.lzxuni.service.RhDataService;

@Service("rhDataService")
public class RhDataServiceImpl implements RhDataService {
	@Autowired
	private RhDataMapper rhDataMapper;

	@Override
	public PageInfo<?> findRhDataList(int pageNumber, int pageSize,
			RhDataCustom rhDataCustom) throws Exception {
		PageHelper.startPage(pageNumber, pageSize).setOrderBy("createTime desc");
		List<RhDataCustom> list = rhDataMapper.findRhDataList(rhDataCustom);
		PageInfo pageInfo = new PageInfo(list);
		return pageInfo;
	}

	@Override
	public void insertRhData(Map<String, Object> map) throws Exception {
		rhDataMapper.insertRhData(map);
		
	}

	@Override
	public Integer findRhDataInspect(String userkey, String createTime) {
		
		return rhDataMapper.findRhDataInspect(userkey, createTime);
	}

	@Override
	public PageInfo<?> findRhGroupList(int pageNumber, int pageSize,
			RhDataCustom rhDataCustom) throws Exception {
		PageHelper.startPage(pageNumber, pageSize).setOrderBy("userkey desc");
		List<RhDataCustom> list = rhDataMapper.findRhGroupList(rhDataCustom);
		PageInfo pageInfo = new PageInfo(list);
		return pageInfo;
	}

	@Override
	public List<RhDataCustom> findRhDataList(RhDataCustom rhDataCustom)
			throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<RhDataCustom> findRhDataByTime(String createTime)
			throws Exception {
		
		return rhDataMapper.findRhDataByTime(createTime);
	}



}
